﻿@model VideoCache.Server.Model.NetbarInfo
@{
    ViewBag.Title = "为商户充值";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}
@section script
{
    <script type="text/javascript">
        function myformatter(date) {
            var y = date.getFullYear();
            var m = date.getMonth() + 1;
            var d = date.getDate();
            return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
        }
        function myparser(s) {
            if (!s) return new Date();
            var ss = (s.split('-'));
            var y = parseInt(ss[0], 10);
            var m = parseInt(ss[1], 10);
            var d = parseInt(ss[2], 10);
            if (!isNaN(y) && !isNaN(m) && !isNaN(d)) {
                return new Date(y, m - 1, d);
            } else {
                return new Date();
            }
        }  
    </script>
}
<h2 class="pageTitle">@ViewBag.Title</h2>
<div class="ten-form wrap">
    @using (Html.BeginForm())
    {
        <fieldset>
            <legend>@Model.Name</legend>
            <dl>
                <dt>商户编号</dt>
                <dd>@Model.Id</dd>
            </dl>
            <dl>
                <dt>商户等级</dt>
                <dd>
                    @if (Model.Level == 1)
                    {
                        <span>VIP</span>
                    }
                    else
                    {
                        <span>免费</span>
                    }
                </dd>
            </dl>
            <dl>
                <dt>状态</dt>
                <dd>@Model.Status</dd>
            </dl>
            <dl>
                <dt>所在省份</dt>
                <dd>@Model.Province</dd>
            </dl>
            <dl>
                <dt>所在城市</dt>
                <dd>@Model.City</dd>
            </dl>
            <dl>
                <dt>所在区县</dt>
                <dd>@Model.District</dd>
            </dl>
            <dl>
                <dt>详细地址</dt>
                <dd>@Model.Address</dd>
            </dl>
            <dl>
                <dt>联系人</dt>
                <dd>@Model.ContactPerson</dd>
            </dl>
            <dl>
                <dt>联系电话</dt>
                <dd>@Model.Telephone @Model.MobilePhone</dd>
            </dl>
            <dl>
                <dt>电脑数量</dt>
                <dd>@Model.ComputerNumber</dd>
            </dl>
            <dl>
                <dt>到期时间</dt>
                <dd>
                    <input type="hidden" name="Id" id="Id" value="@Model.Id" />
                    <input type="text" name="ExpiredTime" id="ExpiredTime" value="@Model.ExpiredTime.ToString("yyyy-MM-dd")" class="easyui-datebox" data-options="formatter:myformatter,parser:myparser"} />
                </dd>
            </dl>
        </fieldset>
        <p>
            <button type="submit">
                充值</button>
            @Html.ActionLink("编辑商户资料", "Edit", new { id = Model.Id }) |
            @Html.ActionLink("返回", "Index")
        </p>
    }
</div>
